package com.wenhai.liuyubobobo.imooc.sort;

import java.util.Random;

/**
 * 生成 Array
 *
 * @author wenhai
 * @date 2020/9/10
 */
public class ArrayGenerator {


    public static Integer[] generateOrderedArray(int n) {
        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = i;
        }
        return arr;
    }

    public static Integer[] generateRandomArray(int n, int bound) {
        Integer[] arr = new Integer[n];
        Random rdm = new Random();
        for (int i = 0; i < n; i++) {
            arr[i] = rdm.nextInt(bound);
        }
        return arr;
    }
}
